package com.example.questionnaires.entity;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableLogic;
import lombok.Data;
import java.time.LocalDateTime;
import java.util.List;

@Data
@TableName("questionnaire")
public class Questionnaire {
    @TableId(type = IdType.AUTO)
    private Long id;
    private String title;
    private String description;
    private Long creatorId;
    private Integer status;  // 0: 未发布, 1: 已发布, 2: 已结束
    private LocalDateTime startTime;
    private LocalDateTime endTime;
    private LocalDateTime createTime;
    private LocalDateTime updateTime;
    private Integer viewCount;  // 浏览量
    @TableLogic
    private Integer deleted;  // 添加逻辑删除字段
    
    @TableField(exist = false)
    private List<Question> questions;
} 